package com.zyf.project.kvdb.protocol.proto;

import com.zyf.project.binaryproto.annotation.DataContract;
import com.zyf.project.binaryproto.annotation.DataField;
import com.zyf.project.binaryproto.type.PrimitiveType;
import com.zyf.project.kvdb.protocol.constants.Constants;

/**
 * <h1>数据库集群信息</h1>
 *
 * @author Zhou Yifan
 */
@DataContract(code = Constants.DATABASE_INFO)
public interface DatabaseClusterInfo {

    /**
     * 判断是否是集群
     *
     * @return 布尔值
     */
    @DataField(order = 0, primitiveType = PrimitiveType.BOOLEAN)
    boolean isClusterMode();

    /**
     * 获取集群项
     *
     * @return {@link ClusterItem}
     */
    @DataField(order = 1, refContract = true)
    ClusterItem getClusterItem();

}
